.TH "sp_playlist_callbacks" 3spotify "Wed Mar 28 2012" "libspotify" \" -*- nroff -*-
.ad l
.nh
.SH NAME
sp_playlist_callbacks \- 
.SH SYNOPSIS
.br
.PP
.PP
\fC#include <api\&.h>\fP
.SS "Data Fields"

.in +1c
.ti -1c
.RI "void(* \fBtracks_added\fP )(\fBsp_playlist\fP *pl, \fBsp_track\fP *const *tracks, int num_tracks, int position, void *userdata)"
.br
.ti -1c
.RI "void(* \fBtracks_removed\fP )(\fBsp_playlist\fP *pl, const int *tracks, int num_tracks, void *userdata)"
.br
.ti -1c
.RI "void(* \fBtracks_moved\fP )(\fBsp_playlist\fP *pl, const int *tracks, int num_tracks, int new_position, void *userdata)"
.br
.ti -1c
.RI "void(* \fBplaylist_renamed\fP )(\fBsp_playlist\fP *pl, void *userdata)"
.br
.ti -1c
.RI "void(* \fBplaylist_state_changed\fP )(\fBsp_playlist\fP *pl, void *userdata)"
.br
.ti -1c
.RI "void(* \fBplaylist_update_in_progress\fP )(\fBsp_playlist\fP *pl, bool done, void *userdata)"
.br
.ti -1c
.RI "void(* \fBplaylist_metadata_updated\fP )(\fBsp_playlist\fP *pl, void *userdata)"
.br
.ti -1c
.RI "void(* \fBtrack_created_changed\fP )(\fBsp_playlist\fP *pl, int position, \fBsp_user\fP *user, int when, void *userdata)"
.br
.ti -1c
.RI "void(* \fBtrack_seen_changed\fP )(\fBsp_playlist\fP *pl, int position, bool seen, void *userdata)"
.br
.ti -1c
.RI "void(* \fBdescription_changed\fP )(\fBsp_playlist\fP *pl, const char *desc, void *userdata)"
.br
.ti -1c
.RI "void(* \fBimage_changed\fP )(\fBsp_playlist\fP *pl, const byte *image, void *userdata)"
.br
.ti -1c
.RI "void(* \fBtrack_message_changed\fP )(\fBsp_playlist\fP *pl, int position, const char *message, void *userdata)"
.br
.ti -1c
.RI "void(* \fBsubscribers_changed\fP )(\fBsp_playlist\fP *pl, void *userdata)"
.br
.in -1c
.SH "Detailed Description"
.PP 
Playlist callbacks
.PP
Used to get notifications when playlists are updated\&. If some callbacks should not be of interest, set them to NULL\&. 
.PP
\fBExamples: \fP
.in +1c
\fBbrowse\&.c\fP, and \fBjukebox\&.c\fP\&.
.SH "Field Documentation"
.PP 
.SS "void( * \fBsp_playlist_callbacks::description_changed\fP)(\fBsp_playlist\fP *pl, const char *desc, void *userdata)"
Called when playlist description has changed
.PP
\fBParameters:\fP
.RS 4
\fIpl\fP Playlist object 
.br
\fIdesc\fP New description 
.br
\fIuserdata\fP Userdata passed to \fBsp_playlist_add_callbacks()\fP 
.RE
.PP

.SS "void( * \fBsp_playlist_callbacks::image_changed\fP)(\fBsp_playlist\fP *pl, const byte *image, void *userdata)"
Called when playlist image has changed
.PP
\fBParameters:\fP
.RS 4
\fIpl\fP Playlist object 
.br
\fIimage\fP New image 
.br
\fIuserdata\fP Userdata passed to \fBsp_playlist_add_callbacks()\fP 
.RE
.PP

.SS "void( * \fBsp_playlist_callbacks::playlist_metadata_updated\fP)(\fBsp_playlist\fP *pl, void *userdata)"
Called when metadata for one or more tracks in a playlist has been updated\&.
.PP
\fBParameters:\fP
.RS 4
\fIpl\fP Playlist object 
.br
\fIuserdata\fP Userdata passed to \fBsp_playlist_add_callbacks()\fP 
.RE
.PP

.SS "void( * \fBsp_playlist_callbacks::playlist_renamed\fP)(\fBsp_playlist\fP *pl, void *userdata)"
Called when a playlist has been renamed\&. \fBsp_playlist_name()\fP can be used to find out the new name
.PP
\fBParameters:\fP
.RS 4
\fIpl\fP Playlist object 
.br
\fIuserdata\fP Userdata passed to \fBsp_playlist_add_callbacks()\fP 
.RE
.PP

.SS "void( * \fBsp_playlist_callbacks::playlist_state_changed\fP)(\fBsp_playlist\fP *pl, void *userdata)"
Called when state changed for a playlist\&.
.PP
There are three states that trigger this callback:
.IP "\(bu" 2
Collaboration for this playlist has been turned on or off
.IP "\(bu" 2
The playlist started having pending changes, or all pending changes have now been committed
.IP "\(bu" 2
The playlist started loading, or finished loading
.PP
.PP
\fBParameters:\fP
.RS 4
\fIpl\fP Playlist object 
.br
\fIuserdata\fP Userdata passed to \fBsp_playlist_add_callbacks()\fP 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsp_playlist_is_collaborative\fP 
.PP
\fBsp_playlist_has_pending_changes\fP 
.PP
\fBsp_playlist_is_loaded\fP 
.RE
.PP

.SS "void( * \fBsp_playlist_callbacks::playlist_update_in_progress\fP)(\fBsp_playlist\fP *pl, bool done, void *userdata)"
Called when a playlist is updating or is done updating
.PP
This is called before and after a series of changes are applied to the playlist\&. It allows e\&.g\&. the user interface to defer updating until the entire operation is complete\&.
.PP
\fBParameters:\fP
.RS 4
\fIpl\fP Playlist object 
.br
\fIdone\fP True iff the update is completed 
.br
\fIuserdata\fP Userdata passed to \fBsp_playlist_add_callbacks()\fP 
.RE
.PP

.SS "void( * \fBsp_playlist_callbacks::subscribers_changed\fP)(\fBsp_playlist\fP *pl, void *userdata)"
Called when playlist subscribers changes (count or list of names)
.PP
\fBParameters:\fP
.RS 4
\fIpl\fP Playlist object 
.br
\fIuserdata\fP Userdata passed to \fBsp_playlist_add_callbacks()\fP 
.RE
.PP

.SS "void( * \fBsp_playlist_callbacks::track_created_changed\fP)(\fBsp_playlist\fP *pl, int position, \fBsp_user\fP *user, int when, void *userdata)"
Called when create time and/or creator for a playlist entry changes
.PP
\fBParameters:\fP
.RS 4
\fIpl\fP Playlist object 
.br
\fIposition\fP Position in playlist 
.br
\fIuser\fP User object 
.br
\fItime\fP When entry was created, seconds since the unix epoch\&. 
.br
\fIuserdata\fP Userdata passed to \fBsp_playlist_add_callbacks()\fP 
.RE
.PP

.SS "void( * \fBsp_playlist_callbacks::track_message_changed\fP)(\fBsp_playlist\fP *pl, int position, const char *message, void *userdata)"
Called when message attribute for a playlist entry changes\&.
.PP
\fBParameters:\fP
.RS 4
\fIpl\fP Playlist object 
.br
\fIposition\fP Position in playlist 
.br
\fImessage\fP UTF-8 encoded message 
.br
\fIuserdata\fP Userdata passed to \fBsp_playlist_add_callbacks()\fP 
.RE
.PP

.SS "void( * \fBsp_playlist_callbacks::track_seen_changed\fP)(\fBsp_playlist\fP *pl, int position, bool seen, void *userdata)"
Called when seen attribute for a playlist entry changes\&.
.PP
\fBParameters:\fP
.RS 4
\fIpl\fP Playlist object 
.br
\fIposition\fP Position in playlist 
.br
\fIseen\fP Set if entry it marked as seen 
.br
\fIuserdata\fP Userdata passed to \fBsp_playlist_add_callbacks()\fP 
.RE
.PP

.SS "void( * \fBsp_playlist_callbacks::tracks_added\fP)(\fBsp_playlist\fP *pl, \fBsp_track\fP *const *tracks, int num_tracks, int position, void *userdata)"
Called when one or more tracks have been added to a playlist
.PP
\fBParameters:\fP
.RS 4
\fIpl\fP Playlist object 
.br
\fItracks\fP Array of pointers to track objects 
.br
\fInum_tracks\fP Number of entries in \fCtracks\fP 
.br
\fIposition\fP Position in the playlist for the first track\&. 
.br
\fIuserdata\fP Userdata passed to \fBsp_playlist_add_callbacks()\fP 
.RE
.PP

.PP
\fBExamples: \fP
.in +1c
\fBjukebox\&.c\fP\&.
.SS "void( * \fBsp_playlist_callbacks::tracks_moved\fP)(\fBsp_playlist\fP *pl, const int *tracks, int num_tracks, int new_position, void *userdata)"
Called when one or more tracks have been moved within a playlist
.PP
\fBParameters:\fP
.RS 4
\fIpl\fP Playlist object 
.br
\fItracks\fP Array of positions representing the tracks that were moved 
.br
\fInum_tracks\fP Number of entries in \fCtracks\fP 
.br
\fIposition\fP New position in the playlist for the first track\&. 
.br
\fIuserdata\fP Userdata passed to \fBsp_playlist_add_callbacks()\fP 
.RE
.PP

.SS "void( * \fBsp_playlist_callbacks::tracks_removed\fP)(\fBsp_playlist\fP *pl, const int *tracks, int num_tracks, void *userdata)"
Called when one or more tracks have been removed from a playlist
.PP
\fBParameters:\fP
.RS 4
\fIpl\fP Playlist object 
.br
\fItracks\fP Array of positions representing the tracks that were removed 
.br
\fInum_tracks\fP Number of entries in \fCtracks\fP 
.br
\fIuserdata\fP Userdata passed to \fBsp_playlist_add_callbacks()\fP 
.RE
.PP


.SH "Author"
.PP 
Generated automatically by Doxygen for libspotify from the source code\&.
